<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="lib/vue.js"></script>
</head>

<body>
    <div id="app">
        <div>{{pmsg}}</div>
        <menu-item title='来自父组件的数据'></menu-item>
        <menu-item :title='ptitle'></menu-item>
        <!-- 传递多个值 -->
        <menu-item :title='ptitle' content='hello'></menu-item>
    </div>
    <script>
        Vue.component('menu-item', {
            // props: ['title'],
            props: ['title', 'content'],
            data() {
                return {
                    msg: '自定义子组件的数据'
                }
            },
            template: '<div>{{msg+"---"+title+"---"+content}}</div>'
        })

        var vm = new Vue({
            el: '#app',
            data: {
                pmsg: '父组件的数据',
                ptitle: '动态绑定属性值'
            },
            methods: {}
        });
    </script>
</body>

</html>